package com.share.design.factory.abs.furniture;

/**
 * @author caifan
 * @since 2022/10/23
 */
public class Client {
    private Chair chair;

    private Sofa sofa;

    private Table table;

    public Client(AbstractFactory abstractFactory) {
        chair = abstractFactory.createChair();
        sofa = abstractFactory.createSofa();
        table = abstractFactory.createTable();
    }

    public static void main(String[] args) {
        Client usaClient = new Client(new USAFactory());
        usaClient.table.desc();
        usaClient.sofa.desc();
        usaClient.chair.desc();

        Client chinaClient = new Client(new ChinaFactory());
        chinaClient.table.desc();
        chinaClient.sofa.desc();
        chinaClient.chair.desc();
    }


}
